import datetime
from applications.extensions import db


class YeOperationDetection(db.Model):
    __tablename__ = 'ye_operation_detection'
    __table_args__ = ({'comment': '检测标志表 - 用于检测当前所处的操作步骤,决定下次操作的内容'})  # 添加表注释
    id = db.Column(db.Integer, autoincrement=True, primary_key=True, comment="表id")
    # group_id = db.Column(db.Integer, comment="关联 所属组id")  
    # db.relationship('Role', secondary="admin_user_role", backref=db.backref('user'), lazy='dynamic')
    alias = db.Column(db.String(50), comment="别名")
    remarks = db.Column(db.String(500), comment="备注")
    picture_url = db.Column(db.String(500), comment="标志图片相对地址")
    priority_level = db.Column(db.Integer, comment="标志图片优先级(优先级值越高,将会优先检测,多个标志图片同时被识别到也会优先执行)")
    feature_point = db.Column(db.Integer, comment="特征点匹配数")
    create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')
    
    group_id =  db.Column(db.Integer, comment="外键，关联组id")
    # group_id = db.relationship('YeGroup', backref='yeOperationDetection', lazy='dynamic')

    operation_list = None
